package com.ruoyi.project.oms.service;

import java.time.LocalDateTime;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.oms.mapper.OmsAftersaleMapper;
import com.ruoyi.db.oms.domain.OmsAftersale;
import com.ruoyi.db.oms.domain.query.OmsAftersaleQueryVo;

/**
 * 售后Service业务层处理
 *
 * @author yfy
 * @date 2020-04-25
 */
@Service
public class OmsAftersaleService
{
    @Autowired
    private OmsAftersaleMapper omsAftersaleMapper;

    /**
     * 查询售后
     *
     * @param id 售后ID
     * @return 售后
     */
    public OmsAftersale selectOmsAftersaleById(Long id)
    {
        return omsAftersaleMapper.selectOmsAftersaleById(id);
    }

    /**
     * 查询售后列表
     *
     * @param omsAftersaleQueryVo 售后查询参数
     * @return 售后
     */
    public List<OmsAftersale> selectOmsAftersaleList(OmsAftersaleQueryVo omsAftersaleQueryVo)
    {
        return omsAftersaleMapper.selectOmsAftersaleList(omsAftersaleQueryVo);
    }

    /**
     * 新增售后
     *
     * @param omsAftersale 售后
     * @return 结果
     */
    public int insertOmsAftersale(OmsAftersale omsAftersale)
    {
        return omsAftersaleMapper.insertOmsAftersale(omsAftersale);
    }

    /**
     * 修改售后
     *
     * @param omsAftersale 售后
     * @return 结果
     */
    public int updateOmsAftersale(OmsAftersale omsAftersale)
    {
        omsAftersale.setUpdateTime(LocalDateTime.now());
        return omsAftersaleMapper.updateOmsAftersale(omsAftersale);
    }

    /**
     * 批量删除售后
     *
     * @param ids 需要删除的售后ID
     * @return 结果
     */
    public int deleteOmsAftersaleByIds(Long[] ids)
    {
        return omsAftersaleMapper.deleteOmsAftersaleByIds(ids);
    }

    /**
     * 删除售后信息
     *
     * @param id 售后ID
     * @return 结果
     */
    public int deleteOmsAftersaleById(Long id)
    {
        return omsAftersaleMapper.deleteOmsAftersaleById(id);
    }
}
